<?php
class RewriteController extends AppAdminController {

    public function actionIndex() {

        $this->activemenu = array(
            'level_1'=>'优化推广',
            'level_2'=>'伪静态'
        );

        //获取配置信息
        $isrewrite = $this->connection->createCommand("select * from xm_config where syskey = 'isrewrite' and lang = 'system'")->queryRow();
        $this->data['isrewrite'] = $isrewrite['content'];

        $this->render ('index',$this->data);
    }

    public function actionEdit(){
        $this->connection->createCommand("update xm_config set content = 1 where  syskey = 'isrewrite' ")->execute();
        $this->saveConfig();
        $this->message(true,"伪静态信息编辑成功");
    }

} 